#include <iostream>
#include <string>
#include <vector>

using namespace std;

//1.1��
int main()
{
	return 0;
}
//1.2��
int main()
{
	bool flag = true;
	if (flag)
		return EXIT_SUCCESS;
	else
		return EXIT_FAILURE;
}
//1.3��
int main()
{
	cout << "Hello Word" << endl;
	return 0;
}
//1.4��
int main()
{
	int a = 5;
	int b = 6;
	int c = a * b;
	cout << a << "*" << b << "=" << c << endl;
	return 0;
}
//1.5��
int main()
{
	int a = 5;
	int b = 6;
	int c = 0;
	cout << a << "*" << b << "=" << a * b << endl;
	return 0;
}
//1.6��
int main()
{
	int a = 5;
	int b = 6;
	int c = 0;
	std::cout << "The sum of " << a
			  << "and " << b
			  << "is" << a * b << std::endl;
	return 0;
}
//���򲻺Ϸ�����Ϊ << ��������������������ostream�Ķ����Ҳ���Ҫ����Ķ���
//��������Ϊ�ֺŵ�ԭ��ʹ���������� << ���û��ostream�Ķ����Ҳ����������޷���������һ���ֱ������
//1.9��
int main()
{
	int i = 50;
	int sum = 0;
	while (i < 101)
	{
		sum += i;
		i++;
	}
	cout << "50--100֮��������Ϊ" << sum << endl;
	return 0;
}
//1.10:
int main()
{
	int i = 10;
	cout << "10--0֮������Ϊ" << endl;
	while (i >= 0)
	{
		cout << i << "  ";
		i--;
	}
	return 0;
}
//1.11��
int main()
{
	int a, b;
	cout << "����������������" << endl;
	cin >> a >> b;
	cout << "��������֮�����������Ϊ��" << endl;
	if (a < b)
	{
		a++;
		while (a < b)
		{
			cout << a++ << "  ";
		}
	}
	else
	{
		a--;
		while (a > b)
		{
			cout << a-- << "  ";
		}
	}
	return 0;
}
//1.12��
int main()
{
	int sum = 0;
	for (int i = -100; i <= 100; ++i)
	{
		sum += i;
	}
	cout << sum << endl;
	return 0;
}
//1.13��
int main()
{
	int sum = 0;
	for (int i = 50; i <= 100; ++i)
	{
		sum += i;
	}
	cout << "50--100֮��������Ϊ" << sum << endl;
	return 0;
}
//1.14��
//whileѭ����ѭ����ʼ������while���֮ǰ���������ж�ѭ�����������ִ��ѭ���壬�������Ǹı�ѭ�����Ʊ���������ѭ����
//forѭ������ִ��һ��ѭ����ʼ��䣬��ʽ�ϼ�࣬���ײ�����ѭ����
//1.16��
int main()
{
	int value;
	int sum = 0;
	cout << "������(���Ž�������)��" << endl;
	while (cin >> value)
	{
		sum += value;
	}
	cout << "�����������֮��Ϊ��" << sum << endl;
	return 0;
}
//1.17 - 1.18��
int main()
{
	int currVal = 0, val = 0;
	if (cin >> currVal)
	{
		int cnt = 1;
		while (cin >> val)
		{
			if (val == currVal)
				++cnt;
			else
			{
				cout << currVal << "occurs" << cnt << "times" << endl;
				currVal = val;
				cnt = 1;
			}
		}
		cout << currVal << "occurs" << cnt << "times" << endl;
	}
	return 0;
}
